<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTeachersTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('teachers', function (Blueprint $table) {
            $table->bigInteger('id', true);
            $table->bigInteger('user_id')->nullable()->comment('用户id');
            $table->string('name', 255)->nullable()->comment('姓名');
            $table->string('gender', 255)->nullable()->comment('性别');
            $table->string('major_subject', 255)->nullable()->comment('主学科');
            $table->date('birthday')->nullable()->comment('出生日期');
            $table->string('nation', 255)->nullable()->comment('民族');
            $table->string('native_place', 255)->nullable()->comment('籍贯-省');
            $table->string('native_city', 255)->nullable()->comment('籍贯-市');
            $table->string('id_no', 30)->nullable()->comment('身份证号');
            $table->string('political', 255)->nullable()->comment('政治面貌');
            $table->string('zzmm', 255)->default('')->comment('dec同步政治面貌原始值');
            $table->date('join_date')->nullable()->comment('加入时间');
            $table->string('teacher_no', 255)->nullable()->comment('师训号');
            $table->string('teacher_certificate_no', 255)->nullable()->comment('教师资格证号');
            $table->string('mobile', 255)->nullable()->comment('手机号码');
            $table->string('phone_num', 32)->nullable()->comment('电话号码');
            $table->string('email', 255)->nullable()->comment('邮箱');
            $table->date('teaching_date')->nullable()->comment('从事教师工作时间');
            $table->date('work_date')->nullable()->comment('工作时间');
            $table->date('unit_date')->nullable()->comment('进入本单位日期');
            $table->bigInteger('data_version_id')->nullable();
            $table->string('data_version_name', 20)->nullable();
            $table->boolean('deleted')->nullable()->default(false);
            $table->dateTime('created_at')->nullable()->useCurrent();
            $table->bigInteger('creator_id')->nullable()->default(0);
            $table->dateTime('updated_at')->nullable()->useCurrent();
            $table->integer('updater_id')->nullable()->default(0);
            $table->string('modified_column', 255)->nullable()->comment('被修改过的字段');
            $table->integer('last_group_id')->nullable()->default(0)->comment('用户最终所属组的组id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('teachers');
    }
};
